import React, { Component } from 'react';
import Logo from '../../components/baidu/Logo';
import Search from '../../components/baidu/search';
import HotList from '../../components/baidu/hotList'
import '../../index.css'
class BaiduNode extends Component {
    state = { 
        list:[
            {
                id:1,
                name:'1.开启新的奔赴'
            },
            {
                id:2,
                name:'2.胡新宇家属:遗体在学校后山粮库'
            },
            {
                id:3,
                name:'3.中疾控:中国本轮疫情已接近尾声'
            },
            {
                id:4,
                name:'4.人气足 市场旺 信心强'
            },
            {
                id:5,
                name:'5.胡新宇母亲:多人曾进粮库寻找过'
            },
            {
                id:6,
                name:'6.什么是 “缢吊”?'
            },
        ]
    }
    search=(e)=>{
        // console.log(e);
        this.state.list=this.state.list.filter(item=>item.name.includes(e))
        this.setState({
            list:this.state.list
        })
    }
    render() {
        return (<>
            <div className='baidu'>
                {/* logo */}
               <Logo/>
               {/* 搜索框 */}
               <Search search={this.search}/>
               {/* 列表 */}
                <HotList list={this.state.list}/>
            </div>
        </>);
    }
}

export default BaiduNode;